﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Summary.master" AutoEventWireup="true"
    CodeFile="Period.aspx.cs" Inherits="School_Period" %>

<asp:Content ID="Content1" ContentPlaceHolderID="DetailHeaderContent" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="DetailBodyContent" runat="Server">
    <asp:UpdatePanel ID="uplPeriod" runat="server">
        <ContentTemplate>
            <asp:GridView ID="gvPeriod" runat="server" Width="550px" AutoGenerateColumns="false"
                CssClass="table" ShowFooter="true" OnPageIndexChanging="OnPaging" OnRowEditing="EditPeriod"
                OnRowUpdating="UpdatePeriod" OnRowCancelingEdit="CancelEdit" PageSize="10" OnRowDataBound="gvPeriod_RowDataBound"
                OnRowCreated="gvPeriod_RowCreated">
                <Columns>
                    <asp:TemplateField ItemStyle-Width="30px" HeaderText="PeriodID" Visible="false">
                        <ItemTemplate>
                            <asp:Label ID="lblPeriodID" runat="server" Text='<%# Eval("PeriodID")%>'></asp:Label>
                        </ItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="txtPeriodID" ReadOnly="true" Text="-1" Width="40px" MaxLength="5"
                                runat="server"></asp:TextBox>
                        </FooterTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ItemStyle-Width="100px" HeaderText="Title">
                        <ItemTemplate>
                            <asp:Label ID="lblTitle" runat="server" Text='<%# Eval("Title")%>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtTitle" runat="server" Text='<%# Eval("Title")%>'></asp:TextBox>
                        </EditItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="txtTitle" runat="server"></asp:TextBox>
                        </FooterTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ItemStyle-Width="150px" HeaderText="ShortName">
                        <ItemTemplate>
                            <asp:Label ID="lblShortName" runat="server" Text='<%# Eval("ShortName")%>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtShortName" runat="server" Text='<%# Eval("ShortName")%>'></asp:TextBox>
                        </EditItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="txtShortName" runat="server"></asp:TextBox>
                        </FooterTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ItemStyle-Width="150px" HeaderText="Start Time">
                        <ItemTemplate>
                            <asp:Label ID="lblStartTime" runat="server" Text='<%# Eval("StartTime")%>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtStartTime" runat="server" Text='<%# Eval("StartTime")%>'></asp:TextBox>
                        </EditItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="txtStartTime" MaxLength="10" runat="server"></asp:TextBox>
                        </FooterTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ItemStyle-Width="150px" HeaderText="End Time">
                        <ItemTemplate>
                            <asp:Label ID="lblEndTime" runat="server" Text='<%# Eval("EndTime")%>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtEndTime" runat="server" Text='<%# Eval("EndTime")%>'></asp:TextBox>
                        </EditItemTemplate>
                        <FooterTemplate>
                            <asp:TextBox ID="txtEndTime" MaxLength="10" runat="server"></asp:TextBox>
                        </FooterTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ItemStyle-Width="150px" HeaderText="Take Attendence?">
                        <ItemTemplate>
                            <asp:Label ID="lblTakeAttendence" runat="server" Text='N/A'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:CheckBox ID="chkTakeAttendence" runat="server" Text=''></asp:CheckBox>
                        </EditItemTemplate>
                        <FooterTemplate>
                            <asp:CheckBox ID="chkTakeAttendence" runat="server" Text=''></asp:CheckBox>
                        </FooterTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ItemStyle-Width="150px" HeaderText="Ignore Scheduling?">
                        <ItemTemplate>
                            <asp:Label ID="lblIgnoreSchedule" runat="server" Text='N/A'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:CheckBox ID="chkIgnoreSchedule" runat="server" Text=''></asp:CheckBox>
                        </EditItemTemplate>
                        <FooterTemplate>
                            <asp:CheckBox ID="chkIgnoreSchedule" runat="server" Text=''></asp:CheckBox>
                        </FooterTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ItemStyle-Width="150px" HeaderText="Active">
                        <ItemTemplate>
                            <asp:Label ID="lblActive" runat="server" Text='N/A'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:CheckBox ID="chkActive" runat="server" Text=''></asp:CheckBox>
                        </EditItemTemplate>
                        <FooterTemplate>
                            <asp:CheckBox ID="chkActive" runat="server" Text=''></asp:CheckBox>
                        </FooterTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:LinkButton ID="lnkRemove" runat="server" CommandArgument='<%# Eval("PeriodID")%>'
                                OnClientClick="return confirm('Do you want to delete?')" Text="Delete" OnClick="DeletePeriod"></asp:LinkButton>
                        </ItemTemplate>
                        <FooterTemplate>
                            <asp:Button ID="btnAdd" runat="server" Text="Add" OnClick="AddPeriod" />
                        </FooterTemplate>
                    </asp:TemplateField>
                    <asp:CommandField ShowEditButton="True" />
                </Columns>
                <AlternatingRowStyle CssClass="alt" />
            </asp:GridView>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="gvPeriod" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
